import request from '@utils/request'

//  发起事务列表页
export function startList (query) {
  return request({
    url: '/work/start-list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

//  待签事务列表页
export function claimList (query) {
  return request({
    url: '/work/claim-list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

//  待办事务列表页
export function todoList (query) {
  return request({
    url: '/work/todo-list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

//  已发事务列表页
export function sendList (query) {
  return request({
    url: '/work/send-list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

//  办结事务列表页
export function doneList (query) {
  return request({
    url: '/work/done-list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

//  申请事务列表页
export function getList (data) {
  return request({
    url: '/work/get-list',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      // 'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导出信息
export function exportExcel (data) {
  return request({
    url: '/work/export',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}